home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OExamples / TubeTest.r < prev   
Encoding:
Text File  |  1993-05-07  |  11.1 KB  |  318 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Macintosh Developer Technical Support
  4. #
  5. #    Simple Color QuickDraw Animation Sample Application
  6. #
  7. #    TubeTest
  8. #
  9. #    TubeTest.r    -    Rez Source
  10. #
  11. #    Copyright © 1988 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    1.0                    8/88
  15. #                1.01                9/16/92    GAB
  16. #
  17. #    Components:    TubeTest.p            August 1, 1988
  18. #                TubeTest.r            August 1, 1988
  19. #                TubeTest.make        August 1, 1988
  20. #
  21. #    The TubeTest program is a simple demonstration of how to use the Palette 
  22. #    Manager in a color program.  It has a special color palette that is associated
  23. #    with the main window.  The colors are animated using the Palette Manager 
  24. #    to give a flowing tube effect.  The program is very simple, and the Palette
  25. #    Manager and drawing parts are put in separate subroutines to make it easier
  26. #    to figure out what is happening.
  27. #    
  28. #    The program is still a complete Macintosh application with a Main Event Loop,
  29. #    so there is the extra code to run the MEL.  
  30. #    
  31. #    There is a resource file that is necessary as well, to define the Menus, Window,
  32. #    Dialog, and Palette resources used in the program.  
  33. #
  34. #    See Sample and TESample for the general structure and MultiFinder techniques that
  35. #    we recommend that you use when building a new application.
  36. #
  37. ------------------------------------------------------------------------------*/
  38.  
  39. #include "Types.r"
  40.  
  41. /* These define's are used in the MENU resources to disable specific
  42.    menu items. */
  43. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  44. #define MenuItem1    0b00001
  45. #define MenuItem2    0b00010
  46. #define MenuItem3    0b00100
  47. #define MenuItem4    0b01000
  48. #define MenuItem5    0b10000
  49.  
  50.  
  51. resource 'MENU' (1000, "Apple", preload) {
  52.     1000, textMenuProc,
  53.     AllItems & ~MenuItem2,    /* Disable item #2 */
  54.     enabled, apple,
  55.     {
  56.         "About TubeTest…",
  57.             noicon, nokey, nomark, plain;
  58.         "-",
  59.             noicon, nokey, nomark, plain
  60.     }
  61. };
  62.  
  63. resource 'MENU' (1001, "File", preload) {
  64.     1001, textMenuProc,
  65.     AllItems & ~MenuItem2,    /* Disable item #2 */
  66.     enabled, "File",
  67.     {
  68.         "Totally Tubular",
  69.             noicon, nokey, nomark, plain;
  70.         "-",
  71.             noicon, nokey, nomark, plain;
  72.         "Quit",
  73.             noicon, "Q", nomark, plain
  74.     }
  75. };
  76.  
  77. resource 'MENU' (1002, "Edit", preload) {
  78.     1002, textMenuProc,
  79.     AllItems & ~MenuItem2,    /* Disable items #2 */
  80.     enabled, "Edit",
  81.      {
  82.         "Undo",
  83.             noicon, "Z", nomark, plain;
  84.         "-",
  85.             noicon, nokey, nomark, plain;
  86.         "Cut",
  87.             noicon, "X", nomark, plain;
  88.         "Copy",
  89.             noicon, "C", nomark, plain;
  90.         "Paste",
  91.             noicon, "V", nomark, plain;
  92.         "Clear",
  93.             noicon, nokey, nomark, plain
  94.     }
  95. };
  96.  
  97.  
  98. resource 'WIND' (1000, "Tubeland") {
  99.     {50, 10, 350, 610},
  100.     documentProc, visible, noGoAway, 0x0, "Tubeland"
  101. };
  102.  
  103.  
  104. resource 'DLOG' (1000, "About TubeTest…") {
  105.     {90, 50, 180, 460},
  106.     rDocProc, visible, noGoAway, 0x0, 1000, "TubeAbout"
  107. };
  108.  
  109.  
  110. resource 'DITL' (1000) {
  111.      {
  112. /* 1 */ {60, 167, 81, 244},
  113.         button {
  114.             enabled,
  115.             "OK"
  116.         };
  117. /* 2 */ {5, 10, 60, 400},                /* SourceLanguage Item */
  118.         staticText {
  119.             disabled,
  120.             "Another totally tubular example program from Bo3b Johnson.  "
  121.             "This one shows how to use the Palette Manager, and color animation.  "
  122.             "Version 1.0"
  123.         }
  124.     }
  125. };
  126.  
  127.  
  128. data 'pltt' (1000, preload) {
  129.     $"0098 0000 0000 0000 0000 0000 0000 0000"    /* 150 entries, plus B&W. (152 total) */
  130.  
  131.     $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"    /* white as first guy. */
  132.     $"0000 0000 0000 0002 0000 0000 0000 0000"    /* black as next guy. */
  133.  
  134.     $"FFFF 0000 0000 0004 0000 0000 0000 0000"   /* 25 in first set, ramp up green. */
  135.     $"FFFF 0A40 0000 0004 0000 0000 0000 0000"
  136.     $"FFFF 1480 0000 0004 0000 0000 0000 0000"
  137.     $"FFFF 1EC0 0000 0004 0000 0000 0000 0000"
  138.     $"FFFF 2900 0000 0004 0000 0000 0000 0000"
  139.     $"FFFF 3340 0000 0004 0000 0000 0000 0000"
  140.     $"FFFF 3D80 0000 0004 0000 0000 0000 0000"
  141.     $"FFFF 47C0 0000 0004 0000 0000 0000 0000"
  142.     $"FFFF 5200 0000 0004 0000 0000 0000 0000"
  143.     $"FFFF 5C40 0000 0004 0000 0000 0000 0000"
  144.     $"FFFF 6680 0000 0004 0000 0000 0000 0000"
  145.     $"FFFF 70C0 0000 0004 0000 0000 0000 0000"
  146.     $"FFFF 7B00 0000 0004 0000 0000 0000 0000"
  147.     $"FFFF 8540 0000 0004 0000 0000 0000 0000"
  148.     $"FFFF 8F80 0000 0004 0000 0000 0000 0000"
  149.     $"FFFF 99C0 0000 0004 0000 0000 0000 0000"
  150.     $"FFFF A400 0000 0004 0000 0000 0000 0000"
  151.     $"FFFF AE40 0000 0004 0000 0000 0000 0000"
  152.     $"FFFF B880 0000 0004 0000 0000 0000 0000"
  153.     $"FFFF C2C0 0000 0004 0000 0000 0000 0000"
  154.     $"FFFF CD00 0000 0004 0000 0000 0000 0000"
  155.     $"FFFF D740 0000 0004 0000 0000 0000 0000"
  156.     $"FFFF E180 0000 0004 0000 0000 0000 0000"
  157.     $"FFFF EBC0 0000 0004 0000 0000 0000 0000"
  158.     $"FFFF F600 0000 0004 0000 0000 0000 0000"
  159.  
  160.     $"FFFF FFFF 0000 0004 0000 0000 0000 0000"   /* 2nd set is lowering red. */
  161.     $"F5C0 FFFF 0000 0004 0000 0000 0000 0000"
  162.     $"EB80 FFFF 0000 0004 0000 0000 0000 0000"
  163.     $"E140 FFFF 0000 0004 0000 0000 0000 0000"
  164.     $"D700 FFFF 0000 0004 0000 0000 0000 0000"
  165.     $"CCC0 FFFF 0000 0004 0000 0000 0000 0000"
  166.     $"C280 FFFF 0000 0004 0000 0000 0000 0000"
  167.     $"B840 FFFF 0000 0004 0000 0000 0000 0000"
  168.     $"AE00 FFFF 0000 0004 0000 0000 0000 0000"
  169.     $"A3C0 FFFF 0000 0004 0000 0000 0000 0000"
  170.     $"9980 FFFF 0000 0004 0000 0000 0000 0000"
  171.     $"8F40 FFFF 0000 0004 0000 0000 0000 0000"
  172.     $"8500 FFFF 0000 0004 0000 0000 0000 0000"
  173.     $"7AC0 FFFF 0000 0004 0000 0000 0000 0000"
  174.     $"7080 FFFF 0000 0004 0000 0000 0000 0000"
  175.     $"6640 FFFF 0000 0004 0000 0000 0000 0000"
  176.     $"5C00 FFFF 0000 0004 0000 0000 0000 0000"
  177.     $"51C0 FFFF 0000 0004 0000 0000 0000 0000"
  178.     $"4780 FFFF 0000 0004 0000 0000 0000 0000"
  179.     $"3D40 FFFF 0000 0004 0000 0000 0000 0000"
  180.     $"3300 FFFF 0000 0004 0000 0000 0000 0000"
  181.     $"28C0 FFFF 0000 0004 0000 0000 0000 0000"
  182.     $"1E80 FFFF 0000 0004 0000 0000 0000 0000"
  183.     $"1440 FFFF 0000 0004 0000 0000 0000 0000"
  184.     $"0A00 FFFF 0000 0004 0000 0000 0000 0000"
  185.  
  186.     $"0000 FFFF 0000 0004 0000 0000 0000 0000"   /* 3rd set is raising blue. */
  187.     $"0000 FFFF 0A40 0004 0000 0000 0000 0000"
  188.     $"0000 FFFF 1480 0004 0000 0000 0000 0000"
  189.     $"0000 FFFF 1EC0 0004 0000 0000 0000 0000"
  190.     $"0000 FFFF 2900 0004 0000 0000 0000 0000"
  191.     $"0000 FFFF 3340 0004 0000 0000 0000 0000"
  192.     $"0000 FFFF 3D80 0004 0000 0000 0000 0000"
  193.     $"0000 FFFF 47C0 0004 0000 0000 0000 0000"
  194.     $"0000 FFFF 5200 0004 0000 0000 0000 0000"
  195.     $"0000 FFFF 5C40 0004 0000 0000 0000 0000"
  196.     $"0000 FFFF 6680 0004 0000 0000 0000 0000"
  197.     $"0000 FFFF 70C0 0004 0000 0000 0000 0000"
  198.     $"0000 FFFF 7B00 0004 0000 0000 0000 0000"
  199.     $"0000 FFFF 8540 0004 0000 0000 0000 0000"
  200.     $"0000 FFFF 8F80 0004 0000 0000 0000 0000"
  201.     $"0000 FFFF 99C0 0004 0000 0000 0000 0000"
  202.     $"0000 FFFF A400 0004 0000 0000 0000 0000"
  203.     $"0000 FFFF AE40 0004 0000 0000 0000 0000"
  204.     $"0000 FFFF B880 0004 0000 0000 0000 0000"
  205.     $"0000 FFFF C2C0 0004 0000 0000 0000 0000"
  206.     $"0000 FFFF CD00 0004 0000 0000 0000 0000"
  207.     $"0000 FFFF D740 0004 0000 0000 0000 0000"
  208.     $"0000 FFFF E180 0004 0000 0000 0000 0000"
  209.     $"0000 FFFF EBC0 0004 0000 0000 0000 0000"
  210.     $"0000 FFFF F600 0004 0000 0000 0000 0000"
  211.  
  212.     $"0000 FFFF FFFF 0004 0000 0000 0000 0000"   /* 4th set is lowering green. */
  213.     $"0000 F5C0 FFFF 0004 0000 0000 0000 0000"
  214.     $"0000 EB80 FFFF 0004 0000 0000 0000 0000"
  215.     $"0000 E140 FFFF 0004 0000 0000 0000 0000"
  216.     $"0000 D700 FFFF 0004 0000 0000 0000 0000"
  217.     $"0000 CCC0 FFFF 0004 0000 0000 0000 0000"
  218.     $"0000 C280 FFFF 0004 0000 0000 0000 0000"
  219.     $"0000 B840 FFFF 0004 0000 0000 0000 0000"
  220.     $"0000 AE00 FFFF 0004 0000 0000 0000 0000"
  221.     $"0000 A3C0 FFFF 0004 0000 0000 0000 0000"
  222.     $"0000 9980 FFFF 0004 0000 0000 0000 0000"
  223.     $"0000 8F40 FFFF 0004 0000 0000 0000 0000"
  224.     $"0000 8500 FFFF 0004 0000 0000 0000 0000"
  225.     $"0000 7AC0 FFFF 0004 0000 0000 0000 0000"
  226.     $"0000 7080 FFFF 0004 0000 0000 0000 0000"
  227.     $"0000 6640 FFFF 0004 0000 0000 0000 0000"
  228.     $"0000 5C00 FFFF 0004 0000 0000 0000 0000"
  229.     $"0000 51C0 FFFF 0004 0000 0000 0000 0000"
  230.     $"0000 4780 FFFF 0004 0000 0000 0000 0000"
  231.     $"0000 3D40 FFFF 0004 0000 0000 0000 0000"
  232.     $"0000 3300 FFFF 0004 0000 0000 0000 0000"
  233.     $"0000 28C0 FFFF 0004 0000 0000 0000 0000"
  234.     $"0000 1E80 FFFF 0004 0000 0000 0000 0000"
  235.     $"0000 1440 FFFF 0004 0000 0000 0000 0000"
  236.     $"0000 0A00 FFFF 0004 0000 0000 0000 0000"
  237.  
  238.     $"0000 0000 FFFF 0004 0000 0000 0000 0000"   /* 5th set is raising red. */
  239.     $"0A40 0000 FFFF 0004 0000 0000 0000 0000"
  240.     $"1480 0000 FFFF 0004 0000 0000 0000 0000"
  241.     $"1EC0 0000 FFFF 0004 0000 0000 0000 0000"
  242.     $"2900 0000 FFFF 0004 0000 0000 0000 0000"
  243.     $"3340 0000 FFFF 0004 0000 0000 0000 0000"
  244.     $"3D80 0000 FFFF 0004 0000 0000 0000 0000"
  245.     $"47C0 0000 FFFF 0004 0000 0000 0000 0000"
  246.     $"5200 0000 FFFF 0004 0000 0000 0000 0000"
  247.     $"5C40 0000 FFFF 0004 0000 0000 0000 0000"
  248.     $"6680 0000 FFFF 0004 0000 0000 0000 0000"
  249.     $"70C0 0000 FFFF 0004 0000 0000 0000 0000"
  250.     $"7B00 0000 FFFF 0004 0000 0000 0000 0000"
  251.     $"8540 0000 FFFF 0004 0000 0000 0000 0000"
  252.     $"8F80 0000 FFFF 0004 0000 0000 0000 0000"
  253.     $"99C0 0000 FFFF 0004 0000 0000 0000 0000"
  254.     $"A400 0000 FFFF 0004 0000 0000 0000 0000"
  255.     $"AE40 0000 FFFF 0004 0000 0000 0000 0000"
  256.     $"B880 0000 FFFF 0004 0000 0000 0000 0000"
  257.     $"C2C0 0000 FFFF 0004 0000 0000 0000 0000"
  258.     $"CD00 0000 FFFF 0004 0000 0000 0000 0000"
  259.     $"D740 0000 FFFF 0004 0000 0000 0000 0000"
  260.     $"E180 0000 FFFF 0004 0000 0000 0000 0000"
  261.     $"EBC0 0000 FFFF 0004 0000 0000 0000 0000"
  262.     $"F600 0000 FFFF 0004 0000 0000 0000 0000"
  263.  
  264.     $"FFFF 0000 FFFF 0004 0000 0000 0000 0000"   /* 6th set is lowering blue. */
  265.     $"FFFF 0000 F5C0 0004 0000 0000 0000 0000"
  266.     $"FFFF 0000 EB80 0004 0000 0000 0000 0000"
  267.     $"FFFF 0000 E140 0004 0000 0000 0000 0000"
  268.     $"FFFF 0000 D700 0004 0000 0000 0000 0000"
  269.     $"FFFF 0000 CCC0 0004 0000 0000 0000 0000"
  270.     $"FFFF 0000 C280 0004 0000 0000 0000 0000"
  271.     $"FFFF 0000 B840 0004 0000 0000 0000 0000"
  272.     $"FFFF 0000 AE00 0004 0000 0000 0000 0000"
  273.     $"FFFF 0000 A3C0 0004 0000 0000 0000 0000"
  274.     $"FFFF 0000 9980 0004 0000 0000 0000 0000"
  275.     $"FFFF 0000 8F40 0004 0000 0000 0000 0000"
  276.     $"FFFF 0000 8500 0004 0000 0000 0000 0000"
  277.     $"FFFF 0000 7AC0 0004 0000 0000 0000 0000"
  278.     $"FFFF 0000 7080 0004 0000 0000 0000 0000"
  279.     $"FFFF 0000 6640 0004 0000 0000 0000 0000"
  280.     $"FFFF 0000 5C00 0004 0000 0000 0000 0000"
  281.     $"FFFF 0000 51C0 0004 0000 0000 0000 0000"
  282.     $"FFFF 0000 4780 0004 0000 0000 0000 0000"
  283.     $"FFFF 0000 3D40 0004 0000 0000 0000 0000"
  284.     $"FFFF 0000 3300 0004 0000 0000 0000 0000"
  285.     $"FFFF 0000 28C0 0004 0000 0000 0000 0000"
  286.     $"FFFF 0000 1E80 0004 0000 0000 0000 0000"
  287.     $"FFFF 0000 1440 0004 0000 0000 0000 0000"
  288.     $"FFFF 0000 0A00 0004 0000 0000 0000 0000"
  289.  
  290. /* End of table, all 150 real entries, and 2 for B&W. */
  291. };
  292.  
  293.  
  294. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  295.  
  296. resource 'SIZE' (-1) {
  297.     saveScreen,
  298.     acceptSuspendResumeEvents,
  299.     disableOptionSwitch,
  300.     canBackground,
  301.     needsActivateOnFGSwitch,    /* this says we do our own activate/deactivate; don't fake us out */
  302.     backgroundAndForeground,    /* this is definitely note a background-only application! */
  303.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  304.     ignoreAppDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  305.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  306.     notHighLevelEventAware,
  307.     onlyLocalHLEvents,
  308.     notStationeryAware,
  309.     dontUseTextEditServices,
  310.     reserved,
  311.     reserved,
  312.     reserved,
  313.     100 * 1024,                    /* we made this (preferred) size bigger than the other (minimum) size */
  314.                                 /* so you can have more text & scraps */
  315.     100 * 1024                    /* we looked at a heap dump while the program was running */
  316.                                 /* it was using about 27K; we added 13K for stack, text & scraps */
  317. };
  318.